﻿@using GoodMan.Infrastructure.Entities.Entity;
@{
    ViewBag.Title = "我的佣金";
    Layout = "~/Areas/WorkSpace/Views/Shared/_StaffTemplete.cshtml";
    ItemListBox<RebateReport> data = ViewBag.data;
}


<link type="text/css" rel="Stylesheet" href="/content/css/select2.css" />
<div id="content-header">
    <h1>
        我的佣金</h1>
</div>
<div id="breadcrumb">
    <a href="/workspace/staff/index" title="Go to Home" class="tip-bottom"><i class="icon-home">
    </i>首页</a> <a href="/workspace/Staff/myrebate" class="tip-bottom">我的佣金</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <h5>
                        我的佣金</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th width="20%">
                                    年月
                                </th>
                                 <th width="10%">
                                    处理订单量
                                </th>
                                <th width="10%">
                                    成功订单量
                                </th>
                                <th width="10%">
                                    取消订单量
                                </th>
                                <th width="10%">
                                    成功订单金额
                                </th>
                                 <th width="10%">
                                    返点%
                                </th>
                                <th width="10%">
                                    返点金额
                                </th>
                                 <th width="10%">
                                    调整
                                </th>
                                <th width="10%">
                                    佣金
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                if (data != null && data.Data != null && data.Data.Any())
                                {
                                    foreach (var rebate in data.Data)
                                    {
                                        int dealorders = rebate.SuccessOrders + rebate.CancelOrders;
                                        decimal bonusmoney = Math.Round(rebate.SuccessMoney * rebate.Rebate / 100, 2);
                                        decimal lastmoney = bonusmoney + rebate.Bonus;
                                         <tr>
                                    <td>
                                        @rebate.Year -  @rebate.Month
                                    </td>
                                    <td>
                                        @rebate.dormitory.Name
                                    </td>
                                    <td>
                                        @rebate.user.RealName
                                    </td>
                                    <td class="center">
                                        @dealorders 
                                    </td>
                                    <td class="center">
                                        @rebate.SuccessOrders
                                    </td>
                                    <td class="center">
                                        @rebate.CancelOrders
                                    </td>
                                    <td class="center">
                                        @rebate.SuccessMoney
                                    </td>
                                        <td class="center">
                                         @(rebate.Rebate)%
                                    </td>
                                    <td class="center">
                                        @bonusmoney
                                    </td>
                                    <td class="center">
                                        @rebate.Bonus
                                    </td>
                                    <td class="center">
                                        @lastmoney
                                    </td>
                                    </tr>
                                    }
                                }
                                else
                                {
                                     <tr>
                                    <td colspan="11" align="center">
                                        无返佣数据
                                    </td>
                                </tr>  
                                }
                      
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(data.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/Scripts/messages_cn.js"></script>
    <script type="text/javascript" src="/Scripts/plug.js"></script>
    <script type="text/javascript" src="/scripts/select2.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likSelf').addClass('open');

            $('#likSelf').addClass('active');
            $('#status').each(function () {
                $(this).select2();
            });
        });
    </script>
}
